<?		
	global $sql;
//# news
	require PATH."view/objects/news.class.php";
	$news 		= new news();
	$menuleftHD		= $news->GetLeftMenuHD();
	$menuleftDC		= $news->GetLeftMenuDC($m[1]);
	$menuleftmovie	= $news->GetLeftMenuMovie();
	$hotnews		= $news->GetListNewsHot();
	
	$listnews	= $news->GetNewsIntro("11","");	
	

	$action		= PATH_HTTP.'Contact.html';	
	if($_REQUEST['re_send']!=""){
		$fullname	= $_REQUEST['re_name'];
		$email		= $_REQUEST['re_email'];
		$address	= $_REQUEST['re_address'];
		$tel		= $_REQUEST['re_tel'];
		$dateadd	= date("Y/m/d H:i");
		$subject	= $_REQUEST['re_title'];
		$content	= addslashes($_REQUEST['re_content']);
		$result	= $sql->query("INSERT INTO contact(c_fullname,c_email,c_address,c_tel,c_subject,c_content,c_dateadd,c_status) VALUES('".$fullname."','".$email."','".$address."','".$tel."','".$subject."','".$content."','".$dateadd."','1')");
		if($result>0){
			//Send mail
				$to 		= pub::GetConfig("email_company");
				$from 		= $email;
				$title 		= $subject;	
					
				$Headers="From:".$from."\n";
				$Headers.="Reply-To:".$from."\n";			
				$Headers.="Content-Type: text/html; charset=\"UTF-8\"; boundary=\"MIME_BOUNDRY\"\n";
				$Headers.="X-Sender:".$title."\n";
				$Headers.="X-Mailer: PHP5\n"; 
				$Headers.="X-Priority: 3\n"; 
				$Headers.="Return-Path:".$from."\n";
				$Subject = $subject;
					
				$content .= "============== CONTACT FROM =====================<br />
							
							".FULLNAME." : ".$fullname." :<br>
							".EMAIL." : ".$email."<br>
							".TEL." : ".$tel."<br>
							".ADDRESS." : ".$address."<br>
							".EMAIL." : ".$email."<br>
							<a href='".WEBSITE."'>".WEBSITE."</a><br>				
							=================== CONTENT ========================<br />
							".addslashes($content)."							
							===========================================================<br />";
				
				$content.= date('d-m-y H:i')."<br />";
				
			if(mail($to,$Subject,$content,$Headers)) {							
				$message	= CONTACT_SUCCESS;
				$str= $pub->direct("".PATH_HTTP."",$message);
			}
			else {			
				$message	= CONTACT_SUCCESS;
				$str= $pub->direct("".PATH_HTTP."",$message);
			}	
		}
	}
?>